3.266 \(\int \frac{(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx\)

Optimal. Leaf size=143 \[ \frac{x \left (2 A d (2 c-d)+B \left (2 c^2-4 c d+3 d^2\right )\right )}{2 a}+\frac{2 d (A (c-d)-B (2 c-d)) \cos (e+f x)}{a f}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{f (a \sin (e+f x)+a)}+\frac{d^2 (2 A-3 B) \sin (e+f x) \cos (e+f x)}{2 a f} \]

[Out]

((2*A*(2*c - d)*d + B*(2*c^2 - 4*c*d + 3*d^2))*x)/(2*a) + (2*(A*(c - d) - B*(2*c - d))*d*Cos[e + f*x])/(a*f) +
 ((2*A - 3*B)*d^2*Cos[e + f*x]*Sin[e + f*x])/(2*a*f) - ((A - B)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(f*(a + a
*Sin[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.205708, antiderivative size = 141, normalized size of antiderivative = 0.99, number of steps used = 2, number of rules used = 2, integrand size = 35, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.057, Rules used = {2977, 2734} \[ \frac{x \left (d^2 (-(2 A-3 B))+4 A c d+2 B c (c-2 d)\right )}{2 a}+\frac{2 d (A (c-d)-B (2 c-d)) \cos (e+f x)}{a f}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{f (a \sin (e+f x)+a)}+\frac{d^2 (2 A-3 B) \sin (e+f x) \cos (e+f x)}{2 a f} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/(a + a*Sin[e + f*x]),x]

[Out]

((2*B*c*(c - 2*d) + 4*A*c*d - (2*A - 3*B)*d^2)*x)/(2*a) + (2*(A*(c - d) - B*(2*c - d))*d*Cos[e + f*x])/(a*f) +
 ((2*A - 3*B)*d^2*Cos[e + f*x]*Sin[e + f*x])/(2*a*f) - ((A - B)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(f*(a + a
*Sin[e + f*x]))

Rule 2977

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x]
)^n)/(a*f*(2*m + 1)), x] - Dist[1/(a*b*(2*m + 1)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n -
1)*Simp[A*(a*d*n - b*c*(m + 1)) - B*(a*c*m + b*d*n) - d*(a*B*(m - n) + A*b*(m + n + 1))*Sin[e + f*x], x], x],
x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ
[m, -2^(-1)] && GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])

Rule 2734

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((2*a*c
+ b*d)*x)/2, x] + (-Simp[((b*c + a*d)*Cos[e + f*x])/f, x] - Simp[(b*d*Cos[e + f*x]*Sin[e + f*x])/(2*f), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps

\begin{align*} \int \frac{(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx &=-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{f (a+a \sin (e+f x))}+\frac{\int (c+d \sin (e+f x)) (a (B (c-2 d)+2 A d)-a (2 A-3 B) d \sin (e+f x)) \, dx}{a^2}\\ &=\frac{\left (2 B c (c-2 d)+4 A c d-(2 A-3 B) d^2\right ) x}{2 a}+\frac{2 (A (c-d)-B (2 c-d)) d \cos (e+f x)}{a f}+\frac{(2 A-3 B) d^2 \cos (e+f x) \sin (e+f x)}{2 a f}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{f (a+a \sin (e+f x))}\\ \end{align*}

Mathematica [A]  time = 0.459728, size = 200, normalized size = 1.4 \[ \frac{\left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right ) \left (2 (e+f x) \left (2 A d (2 c-d)+B \left (2 c^2-4 c d+3 d^2\right )\right ) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )+8 (A-B) (c-d)^2 \sin \left (\frac{1}{2} (e+f x)\right )+4 d (B (d-2 c)-A d) \cos (e+f x) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )-B d^2 \sin (2 (e+f x)) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )}{4 a f (\sin (e+f x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/(a + a*Sin[e + f*x]),x]

[Out]

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(8*(A - B)*(c - d)^2*Sin[(e + f*x)/2] + 2*(2*A*(2*c - d)*d + B*(2*c^2 -
 4*c*d + 3*d^2))*(e + f*x)*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2]) + 4*d*(-(A*d) + B*(-2*c + d))*Cos[e + f*x]*(C
os[(e + f*x)/2] + Sin[(e + f*x)/2]) - B*d^2*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*Sin[2*(e + f*x)]))/(4*a*f*(1
 + Sin[e + f*x]))

________________________________________________________________________________________

Maple [B]  time = 0.085, size = 524, normalized size = 3.7 \begin{align*}{\frac{B{d}^{2}}{af} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{3} \left ( 1+ \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{2} \right ) ^{-2}}-2\,{\frac{A \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}{d}^{2}}{af \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}-4\,{\frac{B \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}cd}{af \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}+2\,{\frac{B \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}{d}^{2}}{af \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}-{\frac{B{d}^{2}}{af}\tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \left ( 1+ \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{2} \right ) ^{-2}}-2\,{\frac{A{d}^{2}}{af \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}-4\,{\frac{Bcd}{af \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}+2\,{\frac{B{d}^{2}}{af \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}+4\,{\frac{\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) Acd}{af}}-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) A{d}^{2}}{af}}+2\,{\frac{\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) B{c}^{2}}{af}}-4\,{\frac{\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) Bcd}{af}}+3\,{\frac{\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) B{d}^{2}}{af}}-2\,{\frac{A{c}^{2}}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+4\,{\frac{Acd}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}-2\,{\frac{A{d}^{2}}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+2\,{\frac{B{c}^{2}}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}-4\,{\frac{Bcd}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+2\,{\frac{B{d}^{2}}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x)

[Out]

1/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2*B*tan(1/2*f*x+1/2*e)^3*d^2-2/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2*A*tan(1/2*f*x+1/2
*e)^2*d^2-4/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2*B*tan(1/2*f*x+1/2*e)^2*c*d+2/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2*B*tan(1
/2*f*x+1/2*e)^2*d^2-1/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2*B*tan(1/2*f*x+1/2*e)*d^2-2/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2
*A*d^2-4/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2*B*c*d+2/a/f/(1+tan(1/2*f*x+1/2*e)^2)^2*B*d^2+4/a/f*arctan(tan(1/2*f*x+
1/2*e))*A*c*d-2/a/f*arctan(tan(1/2*f*x+1/2*e))*A*d^2+2/a/f*arctan(tan(1/2*f*x+1/2*e))*B*c^2-4/a/f*arctan(tan(1
/2*f*x+1/2*e))*B*c*d+3/a/f*arctan(tan(1/2*f*x+1/2*e))*B*d^2-2/a/f/(tan(1/2*f*x+1/2*e)+1)*A*c^2+4/a/f/(tan(1/2*
f*x+1/2*e)+1)*A*c*d-2/a/f/(tan(1/2*f*x+1/2*e)+1)*A*d^2+2/a/f/(tan(1/2*f*x+1/2*e)+1)*B*c^2-4/a/f/(tan(1/2*f*x+1
/2*e)+1)*B*c*d+2/a/f/(tan(1/2*f*x+1/2*e)+1)*B*d^2

________________________________________________________________________________________

Maxima [B]  time = 1.4929, size = 818, normalized size = 5.72 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="maxima")

[Out]

(B*d^2*((sin(f*x + e)/(cos(f*x + e) + 1) + 5*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 3*sin(f*x + e)^3/(cos(f*x +
 e) + 1)^3 + 3*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 4)/(a + a*sin(f*x + e)/(cos(f*x + e) + 1) + 2*a*sin(f*x +
 e)^2/(cos(f*x + e) + 1)^2 + 2*a*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + a*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 +
 a*sin(f*x + e)^5/(cos(f*x + e) + 1)^5) + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a) - 4*B*c*d*((sin(f*x + e
)/(cos(f*x + e) + 1) + sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2)/(a + a*sin(f*x + e)/(cos(f*x + e) + 1) + a*sin
(f*x + e)^2/(cos(f*x + e) + 1)^2 + a*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + arctan(sin(f*x + e)/(cos(f*x + e)
+ 1))/a) - 2*A*d^2*((sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2)/(a + a*sin(f*x
 + e)/(cos(f*x + e) + 1) + a*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + ar
ctan(sin(f*x + e)/(cos(f*x + e) + 1))/a) + 2*B*c^2*(arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a + 1/(a + a*sin(f
*x + e)/(cos(f*x + e) + 1))) + 4*A*c*d*(arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a + 1/(a + a*sin(f*x + e)/(cos
(f*x + e) + 1))) - 2*A*c^2/(a + a*sin(f*x + e)/(cos(f*x + e) + 1)))/f

________________________________________________________________________________________

Fricas [B]  time = 2.30239, size = 684, normalized size = 4.78 \begin{align*} \frac{B d^{2} \cos \left (f x + e\right )^{3} - 2 \,{\left (A - B\right )} c^{2} + 4 \,{\left (A - B\right )} c d - 2 \,{\left (A - B\right )} d^{2} +{\left (2 \, B c^{2} + 4 \,{\left (A - B\right )} c d -{\left (2 \, A - 3 \, B\right )} d^{2}\right )} f x - 2 \,{\left (2 \, B c d +{\left (A - B\right )} d^{2}\right )} \cos \left (f x + e\right )^{2} -{\left (2 \,{\left (A - B\right )} c^{2} - 4 \,{\left (A - 2 \, B\right )} c d +{\left (4 \, A - 3 \, B\right )} d^{2} -{\left (2 \, B c^{2} + 4 \,{\left (A - B\right )} c d -{\left (2 \, A - 3 \, B\right )} d^{2}\right )} f x\right )} \cos \left (f x + e\right ) -{\left (B d^{2} \cos \left (f x + e\right )^{2} - 2 \,{\left (A - B\right )} c^{2} + 4 \,{\left (A - B\right )} c d - 2 \,{\left (A - B\right )} d^{2} -{\left (2 \, B c^{2} + 4 \,{\left (A - B\right )} c d -{\left (2 \, A - 3 \, B\right )} d^{2}\right )} f x +{\left (4 \, B c d +{\left (2 \, A - B\right )} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{2 \,{\left (a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(B*d^2*cos(f*x + e)^3 - 2*(A - B)*c^2 + 4*(A - B)*c*d - 2*(A - B)*d^2 + (2*B*c^2 + 4*(A - B)*c*d - (2*A -
3*B)*d^2)*f*x - 2*(2*B*c*d + (A - B)*d^2)*cos(f*x + e)^2 - (2*(A - B)*c^2 - 4*(A - 2*B)*c*d + (4*A - 3*B)*d^2
- (2*B*c^2 + 4*(A - B)*c*d - (2*A - 3*B)*d^2)*f*x)*cos(f*x + e) - (B*d^2*cos(f*x + e)^2 - 2*(A - B)*c^2 + 4*(A
 - B)*c*d - 2*(A - B)*d^2 - (2*B*c^2 + 4*(A - B)*c*d - (2*A - 3*B)*d^2)*f*x + (4*B*c*d + (2*A - B)*d^2)*cos(f*
x + e))*sin(f*x + e))/(a*f*cos(f*x + e) + a*f*sin(f*x + e) + a*f)

________________________________________________________________________________________

Sympy [A]  time = 12.1062, size = 5583, normalized size = 39.04 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))**2/(a+a*sin(f*x+e)),x)

[Out]

Piecewise((4*A*c**2*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2
 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 8*A*c**2*tan(e/2 + f*x/2)**3/(2*a
*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2
*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*A*c**2*tan(e/2 + f*x/2)/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)
**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*A*c*d*f*x*ta
n(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*t
an(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*A*c*d*f*x*tan(e/2 + f*x/2)**4/(2*a*f*tan(e/2 + f*x/2)
**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/
2) + 2*a*f) + 8*A*c*d*f*x*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*t
an(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 8*A*c*d*f*x*tan(e/2 + f*x/2
)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/
2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*A*c*d*f*x*tan(e/2 + f*x/2)/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(
e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*
A*c*d*f*x/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 +
 f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 8*A*c*d*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*
tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f)
- 16*A*c*d*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)
**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 8*A*c*d*tan(e/2 + f*x/2)/(2*a*f*tan(e/2 +
f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2
+ f*x/2) + 2*a*f) - 2*A*d**2*f*x*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 +
4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 2*A*d**2*f*x*tan(e/2
 + f*x/2)**4/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/
2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*A*d**2*f*x*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5
+ 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) +
 2*a*f) - 4*A*d**2*f*x*tan(e/2 + f*x/2)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(
e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 2*A*d**2*f*x*tan(e/2 + f*x/2)/
(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2
 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 2*A*d**2*f*x/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a
*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*A*d**2*tan(e/2 + f*x/
2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x
/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*A*d**2*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan
(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4
*A*d**2*tan(e/2 + f*x/2)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3
 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*A*d**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*t
an(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) +
 2*B*c**2*f*x*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x
/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 2*B*c**2*f*x*tan(e/2 + f*x/2)**4/(2*a*f
*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a
*f*tan(e/2 + f*x/2) + 2*a*f) + 4*B*c**2*f*x*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f
*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 4*B*c**2*
f*x*tan(e/2 + f*x/2)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4
*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 2*B*c**2*f*x*tan(e/2 + f*x/2)/(2*a*f*tan(e/2 + f*
x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 +
f*x/2) + 2*a*f) + 2*B*c**2*f*x/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)
**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*B*c**2*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/
2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(
e/2 + f*x/2) + 2*a*f) - 8*B*c**2*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 +
4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*B*c**2*tan(e/2 + f
*x/2)/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x
/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*B*c*d*f*x*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*
tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f)
- 4*B*c*d*f*x*tan(e/2 + f*x/2)**4/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x
/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 8*B*c*d*f*x*tan(e/2 + f*x/2)**3/(2*a*f*
tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*
f*tan(e/2 + f*x/2) + 2*a*f) - 8*B*c*d*f*x*tan(e/2 + f*x/2)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x
/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*B*c*d*f*x
*tan(e/2 + f*x/2)/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*t
an(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*B*c*d*f*x/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2
+ f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 8*B*c*
d*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a
*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 8*B*c*d*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)
**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/
2) + 2*a*f) - 8*B*c*d*tan(e/2 + f*x/2)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e
/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 8*B*c*d/(2*a*f*tan(e/2 + f*x/2)
**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/
2) + 2*a*f) + 3*B*d**2*f*x*tan(e/2 + f*x/2)**5/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*
tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 3*B*d**2*f*x*tan(e/2 + f*x
/2)**4/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*
x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 6*B*d**2*f*x*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*
f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f
) + 6*B*d**2*f*x*tan(e/2 + f*x/2)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 +
f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) + 3*B*d**2*f*x*tan(e/2 + f*x/2)/(2*a*f
*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a
*f*tan(e/2 + f*x/2) + 2*a*f) + 3*B*d**2*f*x/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan
(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 6*B*d**2*tan(e/2 + f*x/2)**5/
(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2
 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 6*B*d**2*tan(e/2 + f*x/2)**3/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 +
 f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 2*B*d**
2*tan(e/2 + f*x/2)**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a
*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f) - 4*B*d**2*tan(e/2 + f*x/2)/(2*a*f*tan(e/2 + f*x/2)**
5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2)
 + 2*a*f) + 2*B*d**2/(2*a*f*tan(e/2 + f*x/2)**5 + 2*a*f*tan(e/2 + f*x/2)**4 + 4*a*f*tan(e/2 + f*x/2)**3 + 4*a*
f*tan(e/2 + f*x/2)**2 + 2*a*f*tan(e/2 + f*x/2) + 2*a*f), Ne(f, 0)), (x*(A + B*sin(e))*(c + d*sin(e))**2/(a*sin
(e) + a), True))

________________________________________________________________________________________

Giac [A]  time = 1.27307, size = 300, normalized size = 2.1 \begin{align*} \frac{\frac{{\left (2 \, B c^{2} + 4 \, A c d - 4 \, B c d - 2 \, A d^{2} + 3 \, B d^{2}\right )}{\left (f x + e\right )}}{a} - \frac{4 \,{\left (A c^{2} - B c^{2} - 2 \, A c d + 2 \, B c d + A d^{2} - B d^{2}\right )}}{a{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1\right )}} + \frac{2 \,{\left (B d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 4 \, B c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, A d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 2 \, B d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - B d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 4 \, B c d - 2 \, A d^{2} + 2 \, B d^{2}\right )}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 1\right )}^{2} a}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*((2*B*c^2 + 4*A*c*d - 4*B*c*d - 2*A*d^2 + 3*B*d^2)*(f*x + e)/a - 4*(A*c^2 - B*c^2 - 2*A*c*d + 2*B*c*d + A*
d^2 - B*d^2)/(a*(tan(1/2*f*x + 1/2*e) + 1)) + 2*(B*d^2*tan(1/2*f*x + 1/2*e)^3 - 4*B*c*d*tan(1/2*f*x + 1/2*e)^2
 - 2*A*d^2*tan(1/2*f*x + 1/2*e)^2 + 2*B*d^2*tan(1/2*f*x + 1/2*e)^2 - B*d^2*tan(1/2*f*x + 1/2*e) - 4*B*c*d - 2*
A*d^2 + 2*B*d^2)/((tan(1/2*f*x + 1/2*e)^2 + 1)^2*a))/f